Data storage devices using various kinds of media, such as optical disks, magneto-optical disks, flexible magnetic disks, and the like have been known in the art. In particular, hard disk drives (HDDs) have been widely used as storage devices of computers and have been one of the indispensable storage devices for current computer systems. Moreover, HDDs have found widespread application to moving image recording/reproducing apparatuses, car navigation systems, cellular phones, and the like in addition to the computers, due to their outstanding characteristics.
A HDD spins a magnetic disk and moves a head slider to a target data sector to access (read or write) the magnetic disk. Therefore, the HDD may consume more electric power compared with a semiconductor memory and may have slower access speed to the magnetic disk than a semiconductor memory. Particularly, spinning up a spindle motor requires more time than other operations. Accordingly, when the HDD starts up or returns from a power saving mode to reduce power consumption, it requires long process time.
In order to overcome this problem, it has been proposed that a flash memory, a kind of non-volatile semiconductor memory, is implemented in a HDD (refer to Japanese Patent Publication No. 2006-114206, for example). Since the flash memory is a semiconductor memory, it has faster access speed and consumes less power than a magnetic disk. Further, since the flash memory is a non-volatile memory, it can keep data in itself even if the HDD is in a powered-off state.
The capacity of a flash memory to be implemented in an HDD is limited in light of the cost, for example. Therefore, the HDD stores specific user data in the flash memory and other user data on a magnetic disk. For example, storing data which are necessary in starting up a host or are to be frequently accessed by the host in the flash memory achieves reduction in time for starting up the host, improvement in performance of the HDD, and reduction in power consumption during a power saving mode which reduces the rpm of the spindle motor.
The host instructs the HDD to write or retrieve data, specifying a logical block address (LBA), which is an address on a magnetic disk. Therefore, it is necessary that the HDD associate the LBA of user data stored in the flash memory with an address in the flash memory. Specifically, the HDD creates a table to correlate the above two kinds of addresses and refers to the table to access the flash memory. Hereinafter, the table is called a segment table.
The segment table is used after powered off and then powered on again. Accordingly, the HDD stores the segment table on a magnetic disk or in a flash memory; the both of them are non-volatile memories. Typically, the segment table is stored in a flash memory. However, since the flash memory requires a delete and a write operations to rewrite data, frequent updates of the segment table cause degradation in performance.
In response, an idea has been proposed that loads the segment table into a RAM and updates the segment table in the RAM. In addition, it creates log data indicating the updated contents of the segment table and saves the log data to a flash memory. An example of the use of the log data in writing data to a recording medium is disclosed in Japanese Patent Publication No. 2005-134125. The saved log data enables the latest segment table to be restored by using the segment table and the log data in a flash memory even if the latest segment table in the RAM has been deleted by a power shutdown.
From the view point of the performance, it may be preferable to reduce the number of times of saving the segment table. As a result, however, the number of entries in the log data to be saved may become greater. A typical technique to restore data by log data saves log data at every write command accompanied by a write-out operation into the flash memory. Therefore, the number of entries in the log data to be saved increases with the number of write-out operations into the flash memory. Besides, the area for saving the log data has a limit. Accordingly, a technique is demanded to reduce the number of entries in the log data indicating an update of the segment table.
In addition, it may be important to consider the process time in saving the log data. In particular, since a NAND flash memory, which is suitable for storing user data, writes data in a unit of page, a process to save the log data associating with a single write command to a NAND flash memory requires almost the same process time as the process for one data sector. Accordingly, a technique is demanded to reduce the process time in saving the log data indicating an update of the segment table.